/**
 * author：刘启武
 * email:huanself@126.com
 * 备注：备注事项均为不可改变字段
 * 1、如果需要验证必填 请配置 isRequire属性
 * 2、基础组件绑定的值为model
 * 3、组件绑定的属性为prop
 * 4、组件绑定前面的文字属性为：prefix-text
 * 5、组件提供规则校验方法 verifyRule  返回值为bool值
 */
export default {
  componentName: 'hInput',
  title: '输入框',
  description: '',
  screenshot: 'icon-lqw-shurukuang', //图标
  configure: {
    props: [
      {
        name: 'componentName',
        title: {
          label: '组件名称',
          tip: '自定义组件名称在配置过程中便于更快查找',
        },
        setter: 'StringSetter',
        defaultValue: '输入框',
      },
      {
        name: 'type',
        title: {
          label: '类型',
          tip: '原生类型：input textArea',
        },
        setter: {
          componentName: 'SelectSetter',
          props: {
            options: [
              { title: '单行文本', value: 'text' },
              { title: '多行文本', value: 'textarea' },
            ],
          },
        },
        defaultValue: 'text',
      },
      {
        name: 'size',
        title: '尺寸',
        setter: {
          componentName: 'SelectSetter',
          props: {
            options: [
              { title: 'medium', value: 'medium' },
              { title: 'small', value: 'small' },
              { title: 'mini', value: 'mini' },
            ],
          },
        },
        defaultValue: 'medium',
      },
      {
        name: 'value',
        title: '默认值',
        setter: 'StringSetter',
        defaultValue: '',
      },
      {
        name: 'prop',
        title: '绑定属性',
        setter: 'StringSetter',
        defaultValue: '',
      },
      {
        name: 'maxlength',
        title: {
          label: '最大长度',
          tip: '原生属性，最大输入长度',
        },
        setter: 'NumberSetter',
      },
      {
        name: 'minlength',
        title: {
          label: '最小长度',
          tip: '原生属性，最小输入长度',
        },
        setter: 'NumberSetter',
      },
      {
        name: 'placeholder',
        title: '占位文本',
        setter: 'StringSetter',
        defaultValue: '请输入',
      },
      {
        name: 'clearable',
        title: '是否可清空',
        setter: 'BoolSetter',
        defaultValue: true,
      },
      {
        name: 'disabled',
        title: '禁用',
        setter: 'BoolSetter',
        defaultValue: false,
      },
      {
        name: 'prefix-text',
        title: '头部文字',
        setter: 'StringSetter',
        defaultValue: '',
      },
      {
        name: 'suffix-text',
        title: '尾部文字',
        setter: 'StringSetter',
        defaultValue: '',
      },
      {
        name: 'prefix-icon',
        title: '头部图标',
        setter: {
          componentName: 'SelectSetter',
          props: {
            options: [
              { title: '新增', value: 'iconfont icon-lqw-xinzeng' },
              { title: '编辑', value: 'iconfont icon-lqw-bianji' },
              { title: '删除', value: 'iconfont icon-lqw-shanchu' },
              { title: '提交', value: 'iconfont icon-lqw-tijiao' },
              { title: '设置', value: 'iconfont icon-lqw-shezhi' },
            ],
          },
        },
      },
      {
        name: 'suffix-icon',
        title: '尾部图标',
        setter: {
          componentName: 'SelectSetter',
          props: {
            options: [
              { title: '新增', value: 'iconfont icon-lqw-xinzeng' },
              { title: '编辑', value: 'iconfont icon-lqw-bianji' },
              { title: '删除', value: 'iconfont icon-lqw-shanchu' },
              { title: '提交', value: 'iconfont icon-lqw-tijiao' },
              { title: '设置', value: 'iconfont icon-lqw-shezhi' },
            ],
          },
        },
      },
      {
        name: 'rows',
        title: {
          label: '行数',
          tip: '输入框行数，只对 type="textarea" 有效',
        },
        setter: 'NumberSetter',
      },
      {
        name: 'isRequire',
        title: '是否必填',
        setter: 'BoolSetter',
        defaultValue: false,
      },
    ],
    // 支持样式设置
    style: {
      defaultValue: {
        width: '400px',
        height: '60px',
        padding: '10px',
        display: 'inline-block',
      },
    },
  },
}
